#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  test.py
#       Author @  Huoty
#  Create date @  2015-06-03 10:08:17
#  Description @  
# *************************************************************

intnum = 108
floatnum = 1234.567890
num = 123

# Script starts from here

print "十六进制输出："
print "%x" % intnum
print "%X" % intnum
print "%#X" % intnum
print "%#x" % intnum

print "\n浮点数和科学记数法形式输出:"
print "%f" % floatnum
print "%.2f" % floatnum
print "%E" % floatnum
print "%e" % floatnum
print "%g" % floatnum
print "%G" % floatnum
print "%e" % (1111111111111111111111111L)

print "\n整数和字符串输出:"
print "%+d" % 4
print "%+d" % -4
print "we are at %d%%" % 100
print "Your host is: %s" % "earth"
print "Host: %s\tPort:%d" % ("mars", 80)
print "dec: %d/oct: %#o/hex: %#X" % (num, num, num)
print "MM/DD/YY = %02d/%02d/%d" % (2, 15, 67)
print "There are %(howmany)d %(lang)s Quotation Symbols" % {'lang': 'Python', 'howmany': 3}
